
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minium-scale=1.0" />

<title>Agregar Usuario y Password</title>

<script type="text/javascript" language="javascript" src="js/ajax.js"></script>	
<script type="text/javascript" language="javascript" src="js/ajax1.js"></script>	



</head>
<body>
<center><h1>AGREGAR USUARIO Y PASSWORD</h1></center>

<?php //base de datos, contasena, tal y como esta
$conn = oci_connect('antonhy', 'bahamuth', 'localhost/XE'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); }
$idpersona = $_GET['ID'];
?>
<form method="POST" action="insertarusuario.php" onsubmit="return validacion(this)"> 
<!-- datos del formulario, capos de tu base de datos -->
Usuario: <input type="text" name="txtusuario" placeholder="Usuario:"/>
<br />Password: <input type="password" name="txtpassword" placeholder="Password:"/>
<br />Nombre: <input type="text" name="txtnombre" placeholder="Nombre:"/>
<br />Email: <input type="text" name="txtemail" placeholder="Email:"/>
<br />Direccion: <input type="text" name="txtdireccion" placeholder="Direccion:"/>
<br />Edad: <select type="text" name="cboedad">

<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">39</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>

		</select>

<br />Sexo: <select name="cbosexo" />
<option value="Masculino">Masculino</option>
<option value="Femenino">Femenino</option>
		</select>

<br />RFC: <input type="text" name="txtrfc" placeholder="Rfc:"/>
<br />Estado civil: <select name="cbocivil" >
<option value="Soltero">Soltero</option>
<option value="Casado">Casado</option>
</select>


<?php
//base de datos, contasena, tal y como esta
$conn = oci_connect('antonhy', 'bahamuth', 'localhost/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}

$estado=$_SESSION['estado2']=@$_REQUEST['cboestado']; 
$ciudad=$_SESSION['ciudad2']=@$_REQUEST['cbociudad'];
$colonia=$_SESSION['colonia2']=@$_REQUEST['cbocolo'];

//QUERY COMBO 1
$query=oci_parse($conn, "SELECT * FROM ESTADOS"); 
oci_execute($query);

	
?>
<br />ESTADOS:<select name="cboestado" id="cboestado" onchange="from(document.form1.cboestado.value,'midiv','ciudad2.php')">

<option  value="">SELECCIONA....</option>

<?php while($row=oci_fetch_array($query))
{


?>
<option  value="<?php echo  $row['IDESTADO']?>"> <?php echo htmlentities($row['ESTADO']);?></option>

<?php 
}
 ?>
</select>


<div id="midiv">
			
		</div>
	

<div id="midiv2">
			
		</div>

<input type="hidden" name="txtnivel" value='1'/> 
<input type="hidden" name="idpersona" value = '<?php echo $idpersona; ?>'/> 
<br />
<input type="submit" value="Guardar" name="btnGuardar" /> 
</form>

<?php $stid = oci_parse($conn, 'SELECT ID, USUARIO, PASSWORD, IDNIVEL FROM USUARIOS order by ID asc'); 
oci_execute($stid); 

echo "<table border='1' style='font-family:Arial;font-size:10pt'>\n 
<tr bgcolor='#CCC'><td>id</td> 
<td>usuarios registrados</td> 
 
</tr>"; 
/*while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) { 
echo "<tr>\n"; 
foreach ($row as $item) 
{
echo " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "") . "</td>\n"; 
} 
echo "</tr>\n"; } echo "</table>\n"; 
*/
while(($row= oci_fetch_array($stid, OCI_BOTH) ) != false ) 
{
echo "<tr>"; 
echo " <td>".$row ['ID']."</td>";
echo " <td>".$row ['USUARIO']."</td>";

echo "</tr>"; } 
echo "</table>"; 

?>

</body>
</html>
